<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta
            name="viewport"
            content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
        />
        <title>ToDoList — 千锋教育版权所有</title>
        <link rel="stylesheet" href="./assets/css/style.css" />
    </head>
    <body>
        <header>
            <section>
                <form id="form">
                    <label for="title">
                        <img src="https://storage.lynnn.cn/assets/markdown/91147/pictures/2021/04/619cd39e955cea7c6718d38afd084162002a1dab.jpeg?sign=f3720165756a2ba0971a4298d71e755e&t=6077acca" />
                    </label>
                    <input
                        type="text"
                        id="title"
                        name="title"
                        placeholder="添加ToDo"
                        required="required"
                        autocomplete="off"
                    />
                </form>
            </section>
        </header>
        <section>
            <h2>正在进行 <span id="todocount"></span></h2>
            <ol id="todolist" class="demo-box">
                
            </ol>
            <h2>已经完成 <span id="donecount"></span></h2>
            <ul id="donelist">
           
            </ul>
        </section>
        <footer>
            <!-- js渲染  -->
        </footer>
        <script src="./assets/js/jquery-3.5.1.min.js"></script>
        <script type="text/javascript" src="./assets/js/index.js"></script>
        <script>
            const box = document.querySelector('footer')
            const xhr = new XMLHttpRequest()
            xhr.open('GET', '/meizu')

            xhr.onload = function () {
                const res = JSON.parse(xhr.responseText)
                let str = ''
                str = `
                <p>
                    Copyright &copy; 2021 千锋教育 版权所有
                    <a href="javascript:;">京ICP备15058198号</a>
                </p>
                <p>
                    您当前的ip地址是：<strong id="ipv4">${res.endip}</strong>，地理位置：<strong id="addr">${res.country} ${res.area}互联网数据交换中心</strong>
                </p>
                `
                box.innerHTML = str
            }
            xhr.send()
            setPage();
        </script>
    </body>
</html>
